package com.nsi.o2o.util;

/**
 * @author: Luo Zhen
 * @date: 2018/9/7 09:47
 * @description:
 */
public class PathUtil {

    private static String seperator = System.getProperty("file.separator");

    public static String getImageBasePath() {
        String os = System.getProperty("os.name");
        String basePath = "";
        if (os.toLowerCase().startsWith("win")) {
            basePath = "D:/o2o/images";
        } else {
            basePath = "/usr/o2o/images";
        }
        basePath = basePath.replace("/", seperator);
        return basePath;
    }

    public static String getShopImagePath(long shopId) {
        String imagePath = "/upload/shop/" + shopId + "/";
        return imagePath.replace("/", seperator);
    }

    public static String getPersonInfoImagePath() {
        String personInfoImagePath = "/upload/images/item/personinfo/";
        personInfoImagePath = personInfoImagePath.replace("/", seperator);
        return personInfoImagePath;
    }
}
